package com.gbase;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.sql.*;
@SpringBootApplication
public class GbaseTestApplication  {
	 public static void main(String args[]) {


		 try {
		            //gbase.url=jdbc:gbase://127.0.0.1 
		 String url = "jdbc:gbase://192.168.193.128:5258/test1";
		 String user = "root";
		 String passwd = "";


		 Connection connect = DriverManager.getConnection(url, user, passwd);
		 // 连接URL为 jdbc:gbase//服务器地址/数据库名 ，后面的2个参数分别是登陆用户名和密码


		 System.out.println("Success connect Gbase 8a server!");
		 Statement stmt = connect.createStatement();
		 ResultSet rs = stmt.executeQuery("select * from test1");
		 // user 为你表的名称
		 while (rs.next()) {
		 System.out.println(rs.getString("name"));
		 }
		 } catch (Exception e) {
		 System.out.print("get data error!");
		 e.printStackTrace();
		 }
		 }
		}
		